<%-- 
    Document   : index
    Created on : Dec 19, 2011, 12:24:55 AM
    Author     : Hiru
--%>

<%@page import="java.util.List"%>
<%@page import="com.hiruss.efair.entities.Advertisement"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@include file="header.jsp"%>

<div class="content_section">

	<h2><%=request.getAttribute("title")%>
	</h2>

	<%
		List<Advertisement> ads = (List<Advertisement>) request
				.getAttribute("results");
		int count = 0;
		for (Advertisement ad : ads) {
			count++;
			if (count % 3 != 0) {
	%>

	<div class="product_box margin_r35">

		<%
			} else {
		%>
		<div class="product_box">
			<%
				}
			%>

			<h3><%=ad.getItem()%></h3>

			<div class="image_wrapper">
				<a href="get?id=<%=ad.getAddId()%>" target="_parent"><img
					height="108px" width="190px"
					src="/serve?key=<%=ad.getImages().get(0)%>" alt="<%=ad.getItem()%>" /></a>
			</div>

			<p class="price">
				Price:
				<%=ad.getPrice()%></p>
			<a href="get?id=<%=ad.getAddId()%>">Detail</a> | <a href="#">Buy
				Now</a>
		</div>

		<%
			}
		%>
		<div class="cleaner"></div>


		<!-- 	<div class="button_01"> -->
		<!-- 		<a href="#">View All</a> -->
		<!-- 	</div> -->

	</div>

	<%@include file="footer.jsp"%>